package com.audaque.springboot.foshanupload.web.webdemo.mapper;

import com.audaque.springboot.foshanupload.web.webdemo.mapper.covert.TypeCoverter3;
import com.audaque.springboot.foshanupload.web.webdemo.model.domain.Category;
import com.audaque.springboot.foshanupload.web.webdemo.model.domain.GermanRelease;
import com.audaque.springboot.foshanupload.web.webdemo.model.domain.OriginalRelease;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;

@Mapper( uses = TypeCoverter3.class )
public interface MovieMapper2 {

    @Mapping( target = "category", qualifiedByName = "CategoryToString", defaultExpression = "java(\"Unknown\")" )
    @Mapping( target = "title", qualifiedByName = { "TitleTranslator", "EnglishToGerman" } )
    GermanRelease toGerman(OriginalRelease movies );


    @Named("CategoryToString")
    default String defaultValueForQualifier(Category cat) {
       return "1";
    }

}
